<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<link rel="stylesheet" type="text/css" href="/static/component/laytp/module/cityPicker/city-picker.css">
<body id="optPage">
<form class="layui-form layui-form-pane" id="commentForm">
    <div class="page-title"><div class="page-title-con"><span>新建项目花名册</span><div class="move_title"></div><?php include "../public/sub.php";?></div></div>
    <div class="main-container">

        <div class="block-generic">
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>基本信息</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label"><text>*</text>项目名称</label>
                        <div class="layui-input-block">
                            <input type="text" readonly name="enginid" class="layui-input enginid" onclick="openPage('../public/choose_engin_page_xiang.php?dom=enginid&page=labour_xiang','80%','80%')">
                            <div class="choose_div" id="enginid" key="1"></div>
                            <span class="choose_one" onclick="openPage('../public/choose_engin_page_xiang.php?dom=enginid&page=labour_xiang','80%','80%')"><i class="layui-icon layui-icon-search"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">花名册成员</label>
                        <div class="layui-input-block">
                            <input type="text" readonly name="gonger" class="layui-input gonger" onclick="openPage('../public/choose_labour_gong.php?dom=gonger&page=labour_ban&choose_type=checkbox','80%','80%');">
                            <div class="choose_div" id="gonger" key="1"></div>
                            <span class="choose_one" onclick="openPage('../public/choose_labour_gong.php?dom=gonger&page=labour_ban&choose_type=checkbox','80%','80%');"><i class="layui-icon layui-icon-search"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item height_auto">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label label_textarea">备注</label>
                        <div class="layui-input-block">
                            <textarea id="explain" name="explain" placeholder="请输入" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </div>
            </div>

        </div>


    </div>
</form>
<script>

    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;
        render_input_attr();

        facade.ajax({type: 'get', url: ask_labour_xiang_add}).done(function(res){
            if (res.code === 2000) {

                initParseMoney();
                render_from();
            }
        });

        form.on('submit(add)', function(data){
            data.field.gonger = get_choose_val('gonger');
            data.field.enginid = get_choose_val('enginid');

            var validRes = $("#commentForm").valid();
            formValid('enginid');
            if(data.field.enginid == undefined || !data.field.enginid){
                validRes = false;
            }
            if(!validRes){return false;}

            data = parseMoney(data);
            facade.ajax({url: ask_labour_xiang_add, data:data.field}).done(function(res){
                if (res.code === 2000) {
                    dataPostTimeOut();
                }
            });

            return false;
        });

    });


    function set_gonger(data) {
        set_choose_btn_more_other('gonger',data);
    }

</script>
</body>
</html>
